package smartbooks.ui.util;

import java.awt.Color;
import javax.swing.JComponent;
import net.java.balloontip.BalloonTip;
import net.java.balloontip.styles.BalloonTipStyle;
import net.java.balloontip.styles.RoundedBalloonStyle;

/**
 *
 * @author Ankit
 */
public class MyBalloonTip extends BalloonTip {
    BalloonTip myBalloonTip = null;
    //BalloonTipStyle edgedLook = new EdgedBalloonStyle(Color.WHITE, Color.RED);
    BalloonTipStyle edgedLook = new RoundedBalloonStyle(3, 3, Color.WHITE, Color.RED);
    
    /**
     * This is a constructor to create BalloonTip
     * @param jComponent
     * @param text
     */
    public MyBalloonTip(JComponent jComponent, String text) {
        /*
        public URL url = getClass().getResource("../../images/white.jpg");
        try {
            edgedLook = new TexturedBalloonStyle(5, 5, CommonConstants.url, Color.BLACK);
        } catch (IOException ex) {
            Logger.getLogger(MyBalloonTip.class.getName()).log(Level.SEVERE, null, ex);
        }
        * 
        */
        
        myBalloonTip = new BalloonTip(jComponent, text, edgedLook, false);
        myBalloonTip.setVisible(true);
    }
    
    @Override
    public void setVisible(boolean enabled) {
        myBalloonTip.setVisible(enabled);
    }
}